<div class="panel panel-default panel-intro">
    <div class="panel-heading">
        <h3 class="panel-title">入库单明细</h3>
    </div>

    <div class="panel-body">
        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">基本信息</h3>
                    </div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">入库单号:</label>
                                    <p class="form-control-static">{$inbound.inbound_no}</p>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">供应商:</label>
                                    <p class="form-control-static">{$inbound.supplier_name}</p>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">仓库:</label>
                                    <p class="form-control-static">{$inbound.warehouse_name}</p>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">入库日期:</label>
                                    <p class="form-control-static">{$inbound.inbound_date|date='Y-m-d H:i:s',###}</p>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">总金额:</label>
                                    <p class="form-control-static text-primary"><strong>¥{$inbound.total_amount}</strong></p>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">状态:</label>
                                    <p class="form-control-static">
                                        {if $inbound.status == 0}
                                        <span class="label label-default">草稿</span>
                                        {elseif $inbound.status == 1}
                                        <span class="label label-warning">待入库</span>
                                        {elseif $inbound.status == 2}
                                        <span class="label label-success">已入库</span>
                                        {elseif $inbound.status == 3}
                                        <span class="label label-danger">已取消</span>
                                        {/if}
                                    </p>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">操作员:</label>
                                    <p class="form-control-static">{$inbound.operator_name|default='未设置'}</p>
                                </div>
                            </div>
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <label class="control-label">创建时间:</label>
                                    <p class="form-control-static">{$inbound.createtime|date='Y-m-d H:i:s',###}</p>
                                </div>
                            </div>
                        </div>
                        {if $inbound.remark}
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <label class="control-label">备注:</label>
                                    <p class="form-control-static">{$inbound.remark}</p>
                                </div>
                            </div>
                        </div>
                        {/if}
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title">入库明细</h3>
                    </div>
                    <div class="panel-body">
                        <div class="table-responsive">
                            <table class="table table-striped table-bordered">
                                <thead>
                                    <tr>
                                        <th>物料名称</th>
                                        <th>物料编码</th>
                                        <th>申请数量</th>
                                        <th>实际数量</th>
                                        <th>单价</th>
                                        <th>总金额</th>
                                        <th>批次号</th>
                                        <th>质检状态</th>
                                        <th>存放位置</th>
                                        <th>备注</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {volist name="inbound.items" id="item"}
                                    <tr>
                                        <td>{$item.material_name}</td>
                                        <td>{$item.material_code}</td>
                                        <td>{$item.request_quantity} {$item.unit}</td>
                                        <td>{$item.actual_quantity} {$item.unit}</td>
                                        <td>¥{$item.unit_price}</td>
                                        <td>¥{$item.total_amount}</td>
                                        <td>{$item.batch_no|default='-'}</td>
                                        <td>
                                            {if $item.quality_status == 1}
                                            <span class="label label-warning">待检</span>
                                            {elseif $item.quality_status == 2}
                                            <span class="label label-success">合格</span>
                                            {elseif $item.quality_status == 3}
                                            <span class="label label-danger">不合格</span>
                                            {else}
                                            <span class="label label-default">未知</span>
                                            {/if}
                                        </td>
                                        <td>{$item.location|default='-'}</td>
                                        <td>{$item.remark|default='-'}</td>
                                    </tr>
                                    {/volist}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <a href="javascript:history.back();" class="btn btn-default">
                            <i class="fa fa-arrow-left"></i> 返回
                        </a>
                        {if $inbound.status == 1}
                        <a href="scanwork/inventory_management/audit" class="btn btn-primary">
                            <i class="fa fa-check"></i> 去审核
                        </a>
                        {/if}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
